package com.ant.storage.controller;


import com.ant.storage.common.ResultPage;
import com.ant.storage.common.ResultVo;
import com.ant.storage.dto.ContractDto;
import com.ant.storage.pojo.ApplicationRecord;
import com.ant.storage.service.IApplicationRecordService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author melon
 * @since 2024-05-09
 */
@RestController
@RequestMapping("/application-record")
public class ApplicationRecordController {

    @Autowired
    private IApplicationRecordService recordService;

    @ApiOperation(value = "获取合同数据列表")
    @GetMapping("/getApplicationRecordList")
    public ResultPage getApplicationRecordList(ContractDto dto) {
        return ResultPage.success("操作成功", recordService.queryList(dto));
    }

    @ApiOperation(value = "id查询详情")
    @GetMapping("/findApplicationRecordById/{id}")
    public ResultVo findContfindApplicationRecordByIdractById(@PathVariable("id") Integer id) {
        return ResultVo.success("操作成功", recordService.findApplicationRecordById(id));
    }

    @ApiOperation(value = "保存信息")
    @PostMapping("/applicationRecordSave")
    public ResultVo applicationRecordSave(@RequestBody ApplicationRecord dto) {
        return recordService.applicationRecordSave(dto);
    }

    @ApiOperation(value = "修改租赁信息")
    @PostMapping("/contractUpdate")
    public ResultVo contractUpdate(@RequestBody ApplicationRecord dto) {
        return recordService.contractUpdate(dto);
    }




}
